package com.ssm.helong.shop.controller;

import com.ssm.helong.shop.entity.Order;
import com.ssm.helong.shop.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @RequestMapping("addOrder")
    public String addOrder(Order order) {
        orderService.addOrder(order);
        return "";
    }

    @RequestMapping("deleteOrder")
    public String deleteOrder(Integer id) {
        orderService.deleteOrder(id);
        return "";
    }

    @RequestMapping("updateOrder")
    public String updateOrder(Order order) {
        orderService.updateOrder(order);
        return "";
    }
}
